<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>UCARPP: includes/graph.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">UCARPP
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('graph_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">includes/graph.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdbool.h&gt;</code><br/>
<code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="edgeID_8h_source.html">edgeID.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="edgeGraph_8h_source.html">edgeGraph.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for graph.h:</div>
<div class="dyncontent">
<div class="center"><img src="graph_8h__incl.png" border="0" usemap="#includes_2graph_8h" alt=""/></div>
<map name="includes_2graph_8h" id="includes_2graph_8h">
<area shape="rect" id="node9" href="edgeID_8h.html" title="edgeID.h" alt="" coords="227,83,301,112"/><area shape="rect" id="node14" href="edgeGraph_8h.html" title="edgeGraph.h" alt="" coords="5,83,101,112"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="graph_8h__dep__incl.png" border="0" usemap="#includes_2graph_8hdep" alt=""/></div>
<map name="includes_2graph_8hdep" id="includes_2graph_8hdep">
<area shape="rect" id="node3" href="los_8h.html" title="includes/los.h" alt="" coords="280,83,381,112"/><area shape="rect" id="node7" href="stm_8h.html" title="includes/stm.h" alt="" coords="5,160,112,189"/><area shape="rect" id="node11" href="ltm_8h.html" title="rappresenta il livello LTM dell&#39;algoritmo UCARPP" alt="" coords="359,315,460,344"/><area shape="rect" id="node15" href="swap_8h.html" title="includes/swap.h" alt="" coords="419,160,533,189"/><area shape="rect" id="node19" href="main-tools_8h.html" title="includes/main&#45;tools.h" alt="" coords="608,83,752,112"/><area shape="rect" id="node21" href="parser_8h.html" title="includes/parser.h" alt="" coords="776,83,896,112"/><area shape="rect" id="node5" href="add_8h.html" title="includes/add.h" alt="" coords="136,160,243,189"/><area shape="rect" id="node13" href="remove_8h.html" title="includes/remove.h" alt="" coords="267,160,395,189"/><area shape="rect" id="node9" href="LTMConfiguration_8h.html" title="includes/LTMConfiguration.h" alt="" coords="156,237,343,267"/></map>
</div>
</div>
<p><a href="graph_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structGraph.html">Graph</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a4f7d88186b9ead6ef5738717322647e8">EVAL_PURE</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a34c30761ce06236f388cf2d662cbdf71">EVAL_SMART</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a71948c8a8c71cff6cf6d5946f4d1ad97">EVAL_WISE</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a97a6c4b122c50a3e1e232160f0fe81ca">EVAL_FAILED</a>&#160;&#160;&#160;-1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a34856594900f5db4a14e4e03596303c6">INFINITE_WEIGHT</a>&#160;&#160;&#160;__FLT_MAX__*0.000001</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a7e922f6340664fa997b787eb4933cef0">Pweight</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a3a4655e1bed6717e402b00fed86a0a50">WeightMat</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structGraph.html">Graph</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a5d294fbd6d03f6059ecd3a9e5668041c">Graph</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structGraph.html">Graph</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#ae45fa86bc327274fa9c22ce29db31f11">initGraph</a> (int *N, float T, float Q, int depot)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#aa0ce2043674597087c336bfa0dc315e5">initCompleteGraph</a> (int *N, float T, float Q, int depot, <a class="el" href="structEdgeGraph.html">EdgeGraph</a> edge)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a95d25cb8c150c7b95fbefd505bee28c1">initSmartWeights</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a1531bf943233033ea8f57b5aa296a0dc">printGraph</a> (FILE *f, <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#acbf94fe8adce7472a0db9788a9d9bb11">printAdjMatrix</a> (FILE *f, <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, char type)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#af6c419673cb65813148d42087663bff9">printWholeMatrix</a> (FILE *f, <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a26576f17daf1b37754e0bfcac406a647">printEdgeFromGraph</a> (FILE *f, <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> edge)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="edgeGraph_8h.html#ae9263bc51f20141d45a0d487fbbb9985">PedgeGraph</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a2074728058492cdd0094f7fc58eeea74">getEdgeGraph</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> edge)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a22b642cd69197fca2b9fe65b480762e1">getEdgeTimeWeight</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> edge)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a61aeaf35eb1f649a7bc296224eee3ebc">getEdgeLoadWeight</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> edge)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a0dbe24207cb04946ebfb3c1f28d7c8de">getEdgeGraphValue</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, int i, int j, char type)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#af78262f5ef9cf37f127c81f0c51eb24b">isEdgeProfitable</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a23622d71867b1817151285cb760b8205">evaluateEdge</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pedge, int tau, int theta, short mode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a15897981c39a45987da1d9038c877cde">evaluateNonProfitableEdge</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> pedge, int tau, short mode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a0498e7c9027e7617c269d6d7c7f2ad69">setEdgeGraph</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> id, int t, int d, int p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a059b2bddd5e1e7daf98434674a3779dc">setEdgeGraphTime</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, <a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a> id, int t)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a6063777b21e84f848e517916279ce549">setEdgeGraphByIndexes</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, int i, int j, int t, int d, int p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a4c2445aec7362664da1023b4abea4956">dijkstraFiller</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#a53a42ae459a6b3ff232dc3386a3679db">graphCorrector</a> (<a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="graph_8h.html#af4970b0149fbe0e6df67be1354a17c1f">printRemainingResources</a> (FILE *f, <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> pg, int tau, int theta)</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a97a6c4b122c50a3e1e232160f0fe81ca"></a><!-- doxytag: member="graph.h::EVAL_FAILED" ref="a97a6c4b122c50a3e1e232160f0fe81ca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="graph_8h.html#a97a6c4b122c50a3e1e232160f0fe81ca">EVAL_FAILED</a>&#160;&#160;&#160;-1</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a4f7d88186b9ead6ef5738717322647e8"></a><!-- doxytag: member="graph.h::EVAL_PURE" ref="a4f7d88186b9ead6ef5738717322647e8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="graph_8h.html#a4f7d88186b9ead6ef5738717322647e8">EVAL_PURE</a>&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>indica che si vuole utilizzare un valutatore di tipo PURE </p>

</div>
</div>
<a class="anchor" id="a34c30761ce06236f388cf2d662cbdf71"></a><!-- doxytag: member="graph.h::EVAL_SMART" ref="a34c30761ce06236f388cf2d662cbdf71" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="graph_8h.html#a34c30761ce06236f388cf2d662cbdf71">EVAL_SMART</a>&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>indica che si vuole utilizzare un valutatore di tipo SMART </p>

</div>
</div>
<a class="anchor" id="a71948c8a8c71cff6cf6d5946f4d1ad97"></a><!-- doxytag: member="graph.h::EVAL_WISE" ref="a71948c8a8c71cff6cf6d5946f4d1ad97" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="graph_8h.html#a71948c8a8c71cff6cf6d5946f4d1ad97">EVAL_WISE</a>&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>indica che si vuole utilizzare un valutatore di tipo WISE </p>

</div>
</div>
<a class="anchor" id="a34856594900f5db4a14e4e03596303c6"></a><!-- doxytag: member="graph.h::INFINITE_WEIGHT" ref="a34856594900f5db4a14e4e03596303c6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="graph_8h.html#a34856594900f5db4a14e4e03596303c6">INFINITE_WEIGHT</a>&#160;&#160;&#160;__FLT_MAX__*0.000001</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>qualora si debba valutare il peso di un arco con t o d nullo, questo numero e' il valore che assumere il valutatore, ossia il numero che viene considerato peso infinito </p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="a5d294fbd6d03f6059ecd3a9e5668041c"></a><!-- doxytag: member="graph.h::Graph" ref="a5d294fbd6d03f6059ecd3a9e5668041c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structGraph.html">Graph</a>  <a class="el" href="structGraph.html">Graph</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Struttura incapsulante l'intero grafo, caratterizzato anche da due scalari. </p>

</div>
</div>
<a class="anchor" id="a804cfb50d20c745519ebc5a645437049"></a><!-- doxytag: member="graph.h::Pgraph" ref="a804cfb50d20c745519ebc5a645437049" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structGraph.html">Graph</a>* <a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a7e922f6340664fa997b787eb4933cef0"></a><!-- doxytag: member="graph.h::Pweight" ref="a7e922f6340664fa997b787eb4933cef0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>* <a class="el" href="graph_8h.html#a7e922f6340664fa997b787eb4933cef0">Pweight</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>types di comodo per rendere il più chiaro possibile il codice </p>

</div>
</div>
<a class="anchor" id="ad8909b856fa70c7731c787994276fb03"></a><!-- doxytag: member="graph.h::Weight" ref="ad8909b856fa70c7731c787994276fb03" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef float <a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Peso inteso come output di un valutatore. </p>

</div>
</div>
<a class="anchor" id="a3a4655e1bed6717e402b00fed86a0a50"></a><!-- doxytag: member="graph.h::WeightMat" ref="a3a4655e1bed6717e402b00fed86a0a50" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a>** <a class="el" href="graph_8h.html#a3a4655e1bed6717e402b00fed86a0a50">WeightMat</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a4c2445aec7362664da1023b4abea4956"></a><!-- doxytag: member="graph.h::dijkstraFiller" ref="a4c2445aec7362664da1023b4abea4956" args="(Pgraph pg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a4c2445aec7362664da1023b4abea4956">dijkstraFiller</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a23622d71867b1817151285cb760b8205"></a><!-- doxytag: member="graph.h::evaluateEdge" ref="a23622d71867b1817151285cb760b8205" args="(Pgraph pg, PedgeID pedge, int tau, int theta, short mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> <a class="el" href="graph_8h.html#a23622d71867b1817151285cb760b8205">evaluateEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pedge</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tau</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Criterio valutatore del peso (positivo) di un arco, come descritto in documentazione. </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg deve essere gia' stato inizializzato; </li>
<li>edge deve essere gia' stato inizializzato; </li>
<li>la funzione <a class="el" href="graph_8h.html#a95d25cb8c150c7b95fbefd505bee28c1">initSmartWeights()</a> deve essere gia' stata richiamata</li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>un numero compreso tra 0 e +infinito oppure EVAL_FAILED in caso l'utente abbia inserito un valore non accettabile mode </li>
<li>una valutazione statica dell'arco (non coinvolgente dunque lo scenario in cui l'arco sia gia' stato raccolto d altri camion)</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>indica il grafo che contiene l'arco da valutare </td></tr>
    <tr><td class="paramname">edge</td><td>indica le coordinate dell'arco </td></tr>
    <tr><td class="paramname">tau</td><td>indica il tempo che un particolare veicolo ha gia' consumato viaggiando in altri archi </td></tr>
    <tr><td class="paramname">theta</td><td>indica la capacita' che un particolare veicolo ha gia' consumato viaggiando in altri archi </td></tr>
    <tr><td class="paramname">mode</td><td>indica come far funzionare il valutatore; ci sono 3 modalita': <ul>
<li>mode == EVAL_PURE =&gt; modo pure: viene restituito solo il profitto; </li>
<li>mode == EVAL_SMART =&gt; modo smart: viene pesato il profitto sui due costi; </li>
<li>mode == EVAL_WISE =&gt; modo wise: viene pesato il profitto sui costi e sulle risorse; </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>un numero compreso tra 0 e infinito oppure EVAL_FAILED in caso l'utente abbia inserito un valore non accettabile mode </dd></dl>

</div>
</div>
<a class="anchor" id="a15897981c39a45987da1d9038c877cde"></a><!-- doxytag: member="graph.h::evaluateNonProfitableEdge" ref="a15897981c39a45987da1d9038c877cde" args="(Pgraph pg, PedgeID pedge, int tau, short mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> <a class="el" href="graph_8h.html#a15897981c39a45987da1d9038c877cde">evaluateNonProfitableEdge</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pedge</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tau</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Valuta un arco che già si sa non essere interessante dal punto di vista della raccolta/servizio (perchè non profittabile o già servito da altri). Nella fattispecie, se </p>
<ul>
<li>l'arco non è intrinsecamente profittabile, restituisce zero. </li>
<li>l'arco è profittabl valutazioni maggiori corrispondono ad archi migliori. </li>
</ul>

</div>
</div>
<a class="anchor" id="a2074728058492cdd0094f7fc58eeea74"></a><!-- doxytag: member="graph.h::getEdgeGraph" ref="a2074728058492cdd0094f7fc58eeea74" args="(Pgraph pg, PedgeID edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="edgeGraph_8h.html#ae9263bc51f20141d45a0d487fbbb9985">PedgeGraph</a> <a class="el" href="graph_8h.html#a2074728058492cdd0094f7fc58eeea74">getEdgeGraph</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>ritorna un arco del grafo. Dato che l'algoritmo funziona solo con la meta' superiore del grafo questo metodo capisce immediatamente se l'arco passato si trova nella matrice triangola inferiore del grafo oppure no. Se e' cosi' la funzione provvede a ribaltare gli indici. In questo modo la funzione ritorna il riisultato corretto in questi entrambi casi: </p>
<ul>
<li>getEdge(&amp;graph,initEdgeID(3,10)); </li>
<li>getEdge(&amp;graph,initEdgeID(10,3)); E' dunque altamente <b>consigliato</b> utilizzare questa funzione per gestire il grafo! Una altrettanto valida alternativa all'uso di questa funzione e' la funzione <a class="el" href="edgeID_8h.html#a12a0e9b35c558cf175470e2100644338">validateEdgeID()</a>; l'uso di <a class="el" href="edgeID_8h.html#a12a0e9b35c558cf175470e2100644338">validateEdgeID()</a> e' consigliato qualora si voglia accedere piu' e piu' volte allo stesso arco (incrementando quindi l'efficienza); l'uso invece di questa funzione invece e' consigliato quando l'arco deve essere ottenuto una volta soltanto</li>
</ul>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non deve essere NULL; </li>
<li>pg deve essere stato inizializzato con le funzioni presenti in questo header; </li>
<li>edge non deve essere NULL; </li>
<li>la cooridnata i di edge e quella j devono essere diverse, maggiori di zero e minori di __N__; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>un riferimento non NULL ad un arco contenente le sue caratteristiche fisiche.</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da considerare </td></tr>
    <tr><td class="paramname">edge</td><td>le coordinate dell'arco </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>l'edge contenuto nella matrice di adiacenza alle coordinate row=i e column=j </dd></dl>

</div>
</div>
<a class="anchor" id="a0dbe24207cb04946ebfb3c1f28d7c8de"></a><!-- doxytag: member="graph.h::getEdgeGraphValue" ref="a0dbe24207cb04946ebfb3c1f28d7c8de" args="(Pgraph pg, int i, int j, char type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="graph_8h.html#a0dbe24207cb04946ebfb3c1f28d7c8de">getEdgeGraphValue</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a61aeaf35eb1f649a7bc296224eee3ebc"></a><!-- doxytag: member="graph.h::getEdgeLoadWeight" ref="a61aeaf35eb1f649a7bc296224eee3ebc" args="(Pgraph pg, PedgeID edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> <a class="el" href="graph_8h.html#a61aeaf35eb1f649a7bc296224eee3ebc">getEdgeLoadWeight</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>ritorna una valutazione statica dell' arco del grafo dal punto di vista della capacita'. Dato che l'algoritmo funziona solo con la meta' superiore del grafo questo metodo capisce immediatamente se l'arco passato si trova nella matrice triangola inferiore del grafo oppure no. Se e' cosi' la funzione provvede a ribaltare gli indici. In questo modo la funzione ritorna il riisultato corretto in questi entrambi casi: </p>
<ul>
<li>getEdge(&amp;graph,initEdgeID(3,10)); </li>
<li>getEdge(&amp;graph,initEdgeID(10,3)); E' dunque altamente <b>consigliato</b> utilizzare questa funzione per gestire il grafo!</li>
</ul>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non deve essere NULL; </li>
<li>pg deve essere stato inizializzato con le funzioni presenti in questo header; </li>
<li>edge non deve essere NULL; </li>
<li>la cooridnata i di edge e quella j devono essere diverse, maggiori di zero e minori di __N__; </li>
<li>la funzione <a class="el" href="graph_8h.html#a95d25cb8c150c7b95fbefd505bee28c1">initSmartWeights()</a> deve essere gia' stata richiamata </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>il peso dell'arco cercato</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da considerare </td></tr>
    <tr><td class="paramname">edge</td><td>le coordinate dell'arco </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>il peso dell'edge dal punto di vista della capacita' contenuto nella matrice di adiacenza alle coordinate row=i e column=j </dd></dl>

</div>
</div>
<a class="anchor" id="a22b642cd69197fca2b9fe65b480762e1"></a><!-- doxytag: member="graph.h::getEdgeTimeWeight" ref="a22b642cd69197fca2b9fe65b480762e1" args="(Pgraph pg, PedgeID edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#ad8909b856fa70c7731c787994276fb03">Weight</a> <a class="el" href="graph_8h.html#a22b642cd69197fca2b9fe65b480762e1">getEdgeTimeWeight</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>ritorna una valutazione statica dell' arco del grafo dal punto di vista temporale . Dato che l'algoritmo funziona solo con la meta' superiore del grafo questo metodo capisce immediatamente se l'arco passato si trova nella matrice triangola inferiore del grafo oppure no. Se e' cosi' la funzione provvede a ribaltare gli indici. In questo modo la funzione ritorna il riisultato corretto in questi entrambi casi: </p>
<ul>
<li>getEdge(&amp;graph,initEdgeID(3,10)); </li>
<li>getEdge(&amp;graph,initEdgeID(10,3)); E' dunque altamente <b>consigliato</b> utilizzare questa funzione per gestire il grafo!</li>
</ul>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non deve essere NULL; </li>
<li>pg deve essere stato inizializzato con le funzioni presenti in questo header; </li>
<li>edge non deve essere NULL; </li>
<li>la cooridnata i di edge e quella j devono essere diverse, maggiori di zero e minori di __N__; </li>
<li>la funzione <a class="el" href="graph_8h.html#a95d25cb8c150c7b95fbefd505bee28c1">initSmartWeights()</a> deve essere gia' stata richiamata </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>il peso dell'arco cercato</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da considerare </td></tr>
    <tr><td class="paramname">edge</td><td>le coordinate dell'arco </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>il peso dell'edge dal punto di vista temporale contenuto nella matrice di adiacenza alle coordinate row=i e column=j </dd></dl>

</div>
</div>
<a class="anchor" id="a53a42ae459a6b3ff232dc3386a3679db"></a><!-- doxytag: member="graph.h::graphCorrector" ref="a53a42ae459a6b3ff232dc3386a3679db" args="(Pgraph pg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a53a42ae459a6b3ff232dc3386a3679db">graphCorrector</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>dato il grafo passato la funzione si preoccupa di correggere eventuali triangoli all'interno del grafo che non soddisfano la disuguaglianza triangolare. Per esempio se all'interno del grafo esistessero 3 lati formanti un triangolo rispettivamente di lati 1,2,e 10 il correttore si preoccuperebbe di modificare il 10 in valore più consono (in questo caso 3). Generalemente se dato un triangolo qualsiasi all'interno del grafo tale triangolo non soddisfa la condizione: </p>
<p class="formulaDsp">
<img class="formulaDsp" alt="\[ c \leq a+b \]" src="form_7.png"/>
</p>
<p> allora l'ipotenusa viene forzata al valore  a+b </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>il grafo e' meglio che non sia completo </li>
<li>lati non esistenti nella matrice di adiancenza hanno un valore maggiore o uguale a INFINITE </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>il grafo non presenta disuguaglianze triangolari non soddisfatte</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">graph</td><td>il grafo da modificare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa0ce2043674597087c336bfa0dc315e5"></a><!-- doxytag: member="graph.h::initCompleteGraph" ref="aa0ce2043674597087c336bfa0dc315e5" args="(int *N, float T, float Q, int depot, EdgeGraph edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> <a class="el" href="graph_8h.html#aa0ce2043674597087c336bfa0dc315e5">initCompleteGraph</a> </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>N</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>depot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structEdgeGraph.html">EdgeGraph</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>costruisce un nuovo grafo vuoto. La matrice NxN viene allocata in memoria e tutti i valori vengono inizializzati all'edge passato come parametro. Il campo E viene comunque inizializzato a 0.</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>N non e' NULL </li>
<li>edge ha i campi settati correttamente </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>un grafo inizializzato correttamente </li>
<li>il grafo ha dei triangoli che non soddisfano la disuguaglianza triangolare </li>
<li>il grafo non e' completo</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">N</td><td>indica un puntatore ad una variabile indicante il numero di nodi contenuti nel grafo </td></tr>
    <tr><td class="paramname">T</td><td>indica il tempo massimo di ciascun camion </td></tr>
    <tr><td class="paramname">Q</td><td>indica la capacità massima di ciascun camion </td></tr>
    <tr><td class="paramname">depot</td><td>indica il numero del deposito di questo grafo </td></tr>
    <tr><td class="paramname">edge</td><td>indica l'edge da inserire in tutti gli slot della matrice di adiacenza </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae45fa86bc327274fa9c22ce29db31f11"></a><!-- doxytag: member="graph.h::initGraph" ref="ae45fa86bc327274fa9c22ce29db31f11" args="(int *N, float T, float Q, int depot)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a> <a class="el" href="graph_8h.html#ae45fa86bc327274fa9c22ce29db31f11">initGraph</a> </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>N</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>T</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>Q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>depot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>costruisce un nuovo grafo vuoto. La matrice costruita sulla base di N viene allocata in memoria ma i valori contenuti NON sono inizializzati. La variabile E della struttura <a class="el" href="structGraph.html">Graph</a> viene invece inizializzata a 0. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">N</td><td>indica un puntatore ad una variabile indicante il numero di nodi contenuti nel grafo </td></tr>
    <tr><td class="paramname">T</td><td>indica il tempo massimo di ciascun camion </td></tr>
    <tr><td class="paramname">Q</td><td>indica la capacità massima di ciascun camion </td></tr>
    <tr><td class="paramname">depot</td><td>indica il nodo deposito da inserire. Solitamente e' lo zero </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a95d25cb8c150c7b95fbefd505bee28c1"></a><!-- doxytag: member="graph.h::initSmartWeights" ref="a95d25cb8c150c7b95fbefd505bee28c1" args="(Pgraph pg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a95d25cb8c150c7b95fbefd505bee28c1">initSmartWeights</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>inizializza i pesi statici, sia temporali che relativi alla capacita', del grafo. </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non deve essere NULL; </li>
<li>pg deve esere gia' stato inizializzato tramite i costruttori di questo header; </li>
<li>deve essere gia' stata richiamata la funzione <a class="el" href="graph_8h.html#a4c2445aec7362664da1023b4abea4956">dijkstraFiller()</a>; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>all'interno delle matrici timeWM e di loadWM sono espressi i pesi in capacita' e tempo degli archi</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo su cui computare i pesi </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af78262f5ef9cf37f127c81f0c51eb24b"></a><!-- doxytag: member="graph.h::isEdgeProfitable" ref="af78262f5ef9cf37f127c81f0c51eb24b" args="(Pgraph pg, PedgeID pid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="graph_8h.html#af78262f5ef9cf37f127c81f0c51eb24b">isEdgeProfitable</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>pid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>vero sse profitto e domanda dell'arco ij sono non nulli. </dd></dl>

</div>
</div>
<a class="anchor" id="acbf94fe8adce7472a0db9788a9d9bb11"></a><!-- doxytag: member="graph.h::printAdjMatrix" ref="acbf94fe8adce7472a0db9788a9d9bb11" args="(FILE *f, Pgraph pg, char type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#acbf94fe8adce7472a0db9788a9d9bb11">printAdjMatrix</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>stampa su file della matrice di adiacenza. Possibili tre valori per type: 't','p','d' Il flag full stampa triangolare o completa. LA VERSIONE FULL E' DEPRECATA, non è ancora rimossa per testing futuri che pat ha in mente. in ogni caso who cares il format del printato è sempre 3 cifre, 0 delle cui a dx della virgola.</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>f non NULLO </li>
<li>aperto in scrittura </li>
<li>pg non NULLO </li>
<li>type vale o 't' o 'd' o 'p'</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>il su cui stampare il grafo </td></tr>
    <tr><td class="paramname">pg</td><td>il grafo sa stampare </td></tr>
    <tr><td class="paramname">type</td><td>indica quale delle matrici stampare. E' possibile scegliere tra uno di questi valori: <ul>
<li>'t': stampa la matrice dei tempi </li>
<li>'d': stampa la matrice delle domande </li>
<li>'p': stampa la matrice dei profitti </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a26576f17daf1b37754e0bfcac406a647"></a><!-- doxytag: member="graph.h::printEdgeFromGraph" ref="a26576f17daf1b37754e0bfcac406a647" args="(FILE *f, Pgraph pg, PedgeID edge)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a26576f17daf1b37754e0bfcac406a647">printEdgeFromGraph</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>stampa sul file la rappresentazione dell'arco e la rappresentazione delle caratteristiche fisiche dell'arco (tempo, domanda e profitto)</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>f aperto in scrittura </li>
<li>pg non NULL </li>
<li>pg contiene l'<a class="el" href="structEdgeGraph.html">EdgeGraph</a> dell'ID arco edge </li>
<li>edge non NULL</li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>f viene modificato aggiungendo caratteri</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>il file da modificare </td></tr>
    <tr><td class="paramname">pg</td><td>il grafo in cui risiede l'<a class="el" href="structEdgeGraph.html">EdgeGraph</a> indicato da edge </td></tr>
    <tr><td class="paramname">edge</td><td>l'edge da stampare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1531bf943233033ea8f57b5aa296a0dc"></a><!-- doxytag: member="graph.h::printGraph" ref="a1531bf943233033ea8f57b5aa296a0dc" args="(FILE *f, Pgraph pg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a1531bf943233033ea8f57b5aa296a0dc">printGraph</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>stampa l'intero grafo. </p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>f non deve essere NULL </li>
<li>pg non deve essere NULL </li>
<li>pg deve essere stato precedentemente inizializzato tramite la funzione initGraph o initCompleteGraph </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>nel file e' presente una rappresentazione del grafo leggibile </li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>il file su cui stampare il grafo </td></tr>
    <tr><td class="paramname">pg</td><td>il grafo da stampare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af4970b0149fbe0e6df67be1354a17c1f"></a><!-- doxytag: member="graph.h::printRemainingResources" ref="af4970b0149fbe0e6df67be1354a17c1f" args="(FILE *f, Pgraph pg, int tau, int theta)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#af4970b0149fbe0e6df67be1354a17c1f">printRemainingResources</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tau</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>theta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stampa T-tau e Q-theta. </p>

</div>
</div>
<a class="anchor" id="af6c419673cb65813148d42087663bff9"></a><!-- doxytag: member="graph.h::printWholeMatrix" ref="af6c419673cb65813148d42087663bff9" args="(FILE *f, Pgraph pg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#af6c419673cb65813148d42087663bff9">printWholeMatrix</a> </td>
          <td>(</td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a0498e7c9027e7617c269d6d7c7f2ad69"></a><!-- doxytag: member="graph.h::setEdgeGraph" ref="a0498e7c9027e7617c269d6d7c7f2ad69" args="(Pgraph pg, PedgeID id, int t, int d, int p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a0498e7c9027e7617c269d6d7c7f2ad69">setEdgeGraph</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>imposta dei nuovi valori al particolare arco. L'id puo' assumere qualunque valore non nullo</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non e' NULL </li>
<li>id non e' NULL </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>nel grafo pg all'interno della cella puntata da id si trovano i 3 valori t, d e p passati come parametro</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da modificare </td></tr>
    <tr><td class="paramname">id</td><td>l'arco da modificare </td></tr>
    <tr><td class="paramname">t</td><td>il tempo ipiegato per percorrerlo </td></tr>
    <tr><td class="paramname">d</td><td>la quantita' da diminuire al camion qualora l'arco venga soddisfatto </td></tr>
    <tr><td class="paramname">p</td><td>il profitto ricavabile qualora l'arco venga soddisfatto </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6063777b21e84f848e517916279ce549"></a><!-- doxytag: member="graph.h::setEdgeGraphByIndexes" ref="a6063777b21e84f848e517916279ce549" args="(Pgraph pg, int i, int j, int t, int d, int p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a6063777b21e84f848e517916279ce549">setEdgeGraphByIndexes</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>imposta dei nuovi valori al particolare arco. La coppia (i;j) puo' assumere qualunque valore non nullo</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non e' NULL </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd>nel grafo pg all'interno della cella puntata da (i;j) si trovano i 3 valori t, d e p passati come parametro</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da modificare </td></tr>
    <tr><td class="paramname">id</td><td>l'arco da modificare </td></tr>
    <tr><td class="paramname">t</td><td>il tempo ipiegato per percorrerlo </td></tr>
    <tr><td class="paramname">d</td><td>la quantita' da diminuire al camion qualora l'arco venga soddisfatto </td></tr>
    <tr><td class="paramname">p</td><td>il profitto ricavabile qualora l'arco venga soddisfatto </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a059b2bddd5e1e7daf98434674a3779dc"></a><!-- doxytag: member="graph.h::setEdgeGraphTime" ref="a059b2bddd5e1e7daf98434674a3779dc" args="(Pgraph pg, PedgeID id, int t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="graph_8h.html#a059b2bddd5e1e7daf98434674a3779dc">setEdgeGraphTime</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="graph_8h.html#a804cfb50d20c745519ebc5a645437049">Pgraph</a>&#160;</td>
          <td class="paramname"><em>pg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="edgeID_8h.html#a73a3d93dc3a3c49a3e5ec5ec758e309f">PedgeID</a>&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>aggiorna il costo temporale per attraversare questo arco</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>pg non NULL </li>
<li>id non NULL </li>
<li>t positivo non nullo </li>
<li>id e' stato validato in modo che i&lt;j </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd>l'arco indicato da id ha un costo temporale di attraversamento pari a t</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pg</td><td>il grafo da modificare </td></tr>
    <tr><td class="paramname">id</td><td>l'arco da modificare </td></tr>
    <tr><td class="paramname">t</td><td>il nuovo costo temporale dell'arco </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="graph_8h.html">graph.h</a>      </li>

    <li class="footer">Generated on Wed Sep 4 2013 06:38:56 for UCARPP by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
